package com.yuexinduo.loginmodule;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.gyf.immersionbar.ImmersionBar;
import com.yuexinduo.baselibrary.base.BaseMvpActivity;

public class RegisterUserActivity extends BaseMvpActivity implements View.OnClickListener {
    private ImageView back;
    private TextView top;
    private EditText registerPhone;
    private EditText registerCode;
    private TextView registerGain;
    private EditText registerPasswordOne;
    private EditText registerPasswordTwo;
    private CheckBox registerCheck;
    private Button registerButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int bindLayout() {
        return R.layout.activity_register_user;
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .fitsSystemWindows(true)  //使用该属性,必须指定状态栏颜色
                .statusBarColor(R.color.white)
                .init();
    }

    @Override
    protected Activity getActivity() {
        return this;
    }

    @Override
    protected void initCreate() {
        back = (ImageView) findViewById(R.id.back);
        top = (TextView) findViewById(R.id.top);
        registerPhone = (EditText) findViewById(R.id.register_phone);
        registerCode = (EditText) findViewById(R.id.register_code);
        registerGain = (TextView) findViewById(R.id.register_gain);
        registerPasswordOne = (EditText) findViewById(R.id.register_password_one);
        registerPasswordTwo = (EditText) findViewById(R.id.register_password_two);
        registerCheck = (CheckBox) findViewById(R.id.register_check);
        registerButton = (Button) findViewById(R.id.register_button);

        top.setText("注册");
        back.setOnClickListener(this);
        registerButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.back) {
            finish();
        } else if (id == R.id.register_button) {
            if (!registerCheck.isChecked()) {
                Toast.makeText(getActivity(), "请同意相关协议", Toast.LENGTH_SHORT).show();
            } else {
                initHttp();
            }
        }
    }

    private void initHttp() {

    }
}